package yjh.service;

import yjh.pojo.TopicTable;

import java.util.List;

public interface TopicTableService {
    /**
     * 添加题目
     * @param id
     * @param topic
     * @param answer
     * @param importanc
     * @return
     */
    public String addTopic(Integer id,String topic,
                            String answer,Integer importanc);

    /**
     * 删除题目
     * @param topic
     * @return
     */
    public String deleteTopic(String topic);

    /**
     * 修改更新
     * @param afterChangeTopic
     * @param answer
     * @param importanc
     * @param beforeChangeTopic
     * @return
     */
    public String updateTopic( String afterChangeTopic, String answer, Integer importanc,String beforeChangeTopic);

    /**
     * 查询全部题目信息
     * @return
     */
    public List<TopicTable> findAllTopic();

    /**
     * 根据题目查询相关信息
     * @param topic
     * @return
     */
    public TopicTable findOneByTopic(String topic);

    /**
     * 随机抽题
     * @return
     */
    public TopicTable findOneTopicByRandom(int selectType,String data);

    public List<TopicTable> findAllByImportanc(int importanc);

    public String addMid(String topic);

}
